
<?php 

    include '../loginYanZheng.php';

    weiDengLu();

?>

<!DOCTYPE html>
<html lang="ch">
	<meta charset="utf8">
	<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="index.css">
    <link rel="stylesheet" type="text/css" href="lanrenzhijia.css">
    <link rel="stylesheet" type="text/css" href="loaders.css">
    <style type="">
    	.layui-table th{

    		background-color:rgb(84,146,255);
    		color:#fff;
    		border:1px solid black;
    	}
    </style>
<head>
	<title>任务管理</title>
</head>
<body>
	
	<div style="height:30px;"></div>
	
	<div class="layui-fluid">
		<div class="layui-row" >
	      <div class="layui-col-md2">
	              
	              <a href="../jiemian.php"><i class="layui-icon layui-icon-left" style="font-size:20px"></i><div class="doc-icon-name">返回</div></a>

	      </div>
	    </div>
	    <hr>
	    <div class="layui-row">

	    	<div class="layui-col-md12">
	    		<button class="layui-btn layui-btn-normal" onclick="getWeiJiePhone()">异常电话重拨</button>
	    	</div>
	    	
	    </div>
		<div class="layui-row">
			<!-- 表格部分 -->
			<div class="layui-col-md8">
				
				<div class="layui-input-inline">
	         		<input type="text" id="planId"  placeholder="输入要导出未接通电话任务ID" class="layui-input" style="width:200px;">
				</div>
				<div class="layui-input-inline">
	         		<input type="text" id="planIdI"  placeholder="输入要导进去的任务ID" class="layui-input" style="width:200px;">
				</div>

		</div>
				
	</div>

</body>


</html>

<script src="../layui/layui.all.js"></script>

<script type="text/javascript">



	function getWeiJiePhone(){


		var layer=layui.layer;

		var planId=$('#planId').val()

		var planIdI=$('#planIdI').val()

		if(planId!==''||planIdI!==''){

			jsonData={'planId':planId,'pageNo':1,'pageSize':100000}

			json=JSON.stringify(jsonData)

			var index=layer.load()

			$.post('api.php'
				  ,{'type':5
				  	,'url':'/thirdApi/bss/queryPlanPhonePage'
				    ,'data':json }
				  ,function(data,status){

				  	//console.log(data)
				  	var arr=[];
				  	var n=0;

				  	var list=data['body']['list']

				  	console.log(list)

				  	for(var i=0;i<list.length;i++){

				  		if(list[i]['fReason']!==0){

				  			arr[n]=list[i]

				  			n++
				  		}

				  	}


				  	jsonArr=JSON.stringify(arr)



				  	$.post('api.php',{'type':6,planId:planIdI,'data':jsonArr},function(data,status){
				  		

				  			layer.close(index)

				  			layer.msg(data['msg']+'\n导入数据：'+n+'条')

				  	})

				  	

			})

		}else{


			layer.msg('任务ID不能是空值',{icon:1})
		}

	}

	
</script>